let mongoose = require("mongoose");
mongoose.connect("mongodb://localhost:27017/newQY", {
    useNewUrlParser: true,
    useUnifiedTopology: true
}).then(() => {
    console.log("日志-集合连接成功！");
}).catch(() => {
    console.log("集合连接失败！");
})
let schema = mongoose.Schema;
let logList = new schema({
    //创建人账号
    user: {
        type: String,
        required: true,
    },
    //  创建时间
    createTime: {
        required: true,
        type: String,
    },
    // 权限等级
    limit: {
        required: true,
        type: Number,
        default: 0
    },
    //创建人姓名
    userName: {
        required: true,
        default: "修改名字",
        type: String
    },
    // 0 代表登录 1代表添加说说 2代表修改说说
    type: {
        required: true,
        type: Number,
        default: 0
    }
})
let log = mongoose.model("logList", logList);
module.exports = {
    log
}